Given a reference date (e.g. May 1, 2018), I want to identify all requirements changed since that date, BUT ONLY IF THE OBJECT TEXT HAS CHANGED. The attached code snippet seems to work, but since the history type constants aren't defined I am guessing somewhat (originally I just checked if h.attrName="Object Text", but that gave errors for some history types). Does this seem an OK approach?
Date refDate="20 Apr 2018"
Module m=current; if (null m) halt
Object o
History h
Date dLMO
for o in m do
{
if (isDeleted(o) || o."IE Object Type"""!="Requirement") continue
if ((dLMO=o."Last Modified On") < refDate) continue
for h in o do
{
if (h.type!=createObject && h.type!=unDeleteObject &&
h.type!=modifyObject && h.type!=insertOLE &&
h.type!=removeOLE && h.type!=changeOLE &&
h.type!=pasteOLE && h.type!=cutOLE)
{
continue
}
if (h.type!=createObject && h.type!=unDeleteObject)
{
if (h.attrName!="Object Text") continue
}
if (h.date<refDate) continue
print o."Absolute Number" ", "
}
}
strathglass - Wed Jun 06 14:01:12 EDT 2018 |
Re: Detect if Object Text changed since reference date? "modifyObject" history type should also accept the attribute name check - see for example https://www.ibm.com/developerworks/community/forums/html/topic?id=1e2bfc8e-b8d6-4bca-b89b-83fb091c13f5 |
Re: Detect if Object Text changed since reference date? Thanks ... I had actually seen that thread but failed to look close enough since it was about DXL attribute, my mistake. I think that will help! |